<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<title>GT-Grid 教程示例</title>

<link rel="stylesheet" type="text/css" href="../../gt-grid/gt_grid.css" />

<!-- 请根据语言和系统编码,自行选择引入的 gt_msg_...js 文件 (默认的msg文件为UTF-8编码) -->
<script type="text/javascript" src="../../gt-grid/gt_msg_cn.js"></script>




<script type="text/javascript" src="../../gt-grid/gt_grid_all.js"></script>


<script type="text/javascript" >
// 教程中的代码就写在这个区域里.
var data1 = [
   { no : 1 , name :'aaa', age : 12, gender : 'M' , english : 76.5 , math :92 },
   { no : 2 , name :'bbb', age : 11, gender : 'F' , english : 89   , math :87 },
   { no : 3 , name :'ccc', age : 13, gender : 'F' , english : 53   , math :62 }
];

var dsConfig= {
	data : data1 ,

	fields :[
		{name : 'no'     ,  type: 'int'    },
		{name : 'name'      },
		{name : 'age'    ,  type: 'int'    },
		{name : 'gender'    },
		{name : 'english',  type: 'float'  },
		{name : 'math'   ,  type: 'float'  }
	]
};

var colsConfig = [
		{ id : 'no'      , header : "学号" },
		{ id : 'name'    , header : "姓名" },
		{ id : 'age'     , header : "年龄" },
		{ id : 'gender'  , header : "性别" },
		{ id : 'english' , header : "英语" },
		{ id : 'math'    , header : "数学" }
];

var gridConfig={

	id : "grid1",
	
	dataset : dsConfig ,

	columns : colsConfig ,

	container : 'grid1_container', 

	toolbarPosition : 'bottom',

	toolbarContent : 'state'

};

var mygrid=new GT.Grid( gridConfig );

GT.Utils.onLoad( function(){
	mygrid.render();
} );


</script>
</head>

<body>
<!-- grid的容器. -->
<div id="grid1_container" style="width:700px;height:300px">
</div>

 </body>
</html>
